package com.zg.autoform.enm;

/**
 * <p>Description: </p>
 *
 * @author zhanfeng.liang
 * @since 2025/1/20 15:13
 */
public enum ViewSceneEnum {

    FLOW("FLOW","流程视图"),
    ORDINARY("ORDINARY","普通视频");

    private String code;
    private String cn;

    public String getCode(){
        return this.code;
    }

    public String getCn(){
        return this.cn;
    }

    ViewSceneEnum(String code, String cn) {
        this.code = code;
        this.cn = cn;
    }

    public static String getCnByCode(String name) {
        if (null != name) {
            for (ViewSceneEnum enumItem : ViewSceneEnum.values()) {
                if (enumItem.name().equals(name)) {
                    return enumItem.getCn();
                }
            }
        }
        return "";
    }

    public static ViewSceneEnum toEnum(String name) {
        if (null != name) {
            for (ViewSceneEnum e : ViewSceneEnum.values()) {
                if (e.name().equals(name)) {
                    return e;
                }
            }
        }
        return null;
    }
}
